package com.sprouting.personal.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 软件
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2022/9/7 0:48
 */
@Data
@TableName("ps_software")
public class Software extends BaseModel {

    /**
     * 主键
     */
    @TableId
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    private String id;
    /**
     * 隶属用户
     * @see User#getId()
     */
    @CheckNotNull(message = "请选择所属用户", groups = UpdGroup.class)
    private String userId;
    /**
     * 运行平台
     * @see com.sprouting.personal.interfaces.common.Constant.SoftwarePlatform
     */
    @NotNull(message = "请选择运行平台")
    private Integer app;
    /**
     * 软件名称
     */
    @CheckLength(min = 1, max = 150, message = "软件名称超过长度限制")
    @CheckNotNull(message = "请输入软件名称")
    private String name;
    /**
     * 是否在使用
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#YES 在使用
     */
    @NotNull(message = "请选择是否在使用")
    private Integer inUse;
    /**
     * 软件类型-idea、设计等
     * @see Dict#getId()
     */
    @CheckNotNull(message = "请选择软件类型")
    private String typeId;
    /**
     * 本地保存地址
     */
    @CheckLength(max = 400, message = "本地保存地址超过长度限制")
    private String localSaveAddress;
    /**
     * 官网下载地址
     */
    @CheckLength(max = 455, message = "官网下载地址超过长度限制")
    private String officialAddress;
    /**
     * 推荐指数 评分，星星 1-5 ，最高5星
     */
    @NotNull(message = "请对软件进行评分")
    private Integer grade;
    /**
     * 描述
     */
    @CheckLength(max = 900, message = "描述超过长度限制")
    private String describe;
    /**
     * 备注
     */
    @CheckLength(max = 900, message = "备注超过长度限制")
    private String remarks;

}
